<template>
  <!-- hvps111明细-->
  <el-dialog :title="title" center :visible.sync="openState" width="1024px" :close-on-click-modal="false">
    <el-form ref="form" :model="form" label-width="110px" :disabled="true">
      <el-card class="form-card txnInfo-card">
        <div slot="header" class="label-header-msg">
          <span>交易基础信息</span>
        </div>
        <el-row>
          <el-col :span="8">
            <el-form-item label="来往账方向" prop="type">
              <el-select v-model="form.type" placeholder="业务类型">
                <el-option
                    v-for="dict in dictMap.IBPS_TYPE"
                    :key="dict.value"
                    :label="`${dict.text}`"
                    :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="报文编号" prop="pkgno">
              <el-input v-model="form.pkgno"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="报文标识号" prop="pkgid">
              <el-input v-model="form.pkgid"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="系统日期" prop="txdate">
              <el-date-picker v-model="form.txdate" style="width: 100%;" type="date" value-format="yyyyMMdd"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="工作日期" prop="workdate">
              <el-date-picker v-model="form.workdate" style="width: 100%;" type="date" value-format="yyyyMMdd"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="报文发送时间" prop="senderDatetime">
              <el-date-picker v-model="form.senderDatetime" style="width: 100%;" type="datetime" value-format="yyyyMMddHHmmss"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="批量标识" prop="btFlg">
              <el-input v-model="form.btFlg"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="明细笔数" prop="dtlCnt">
              <el-input v-model="form.dtlCnt"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="明细总金额" prop="dltAmt" label-width="110px">
              <ht-amount-input v-model="form.dltAmt" placeholder="明细总金额"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="清算方法" prop="stMethod">
            <el-input v-model="form.stMethod"/>
          </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="指令优先级" prop="instrPrty">
              <el-input v-model="form.instrPrty"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="Charge Bearer" prop="chrgBr">
              <el-input v-model="form.chrgBr"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="业务标识号" prop="seqno">
            <el-input v-model="form.seqno"/>
          </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="端到端标识号" prop="e2eId">
              <el-input v-model="form.e2eId"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="业务类型编码" prop="bizType">
              <el-input v-model="form.bizType"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="货币种类" prop="curcd">
              <el-input v-model="form.curcd" placeholder="人民币-CNY" :disabled="true" style="width: 195px"/>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="金额" prop="amount">
              <ht-amount-input v-model="form.amount" placeholder="金额"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="委托时间" prop="acceptDate">
              <el-date-picker v-model="form.acceptDate" style="width: 100%;" type="date" value-format="yyyyMMdd"/>
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>
      <!--付款人信息-->
      <el-card class="form-card payerInfo-card">
        <div slot="header" class="label-header-msg">
          <span>付款人信息</span>
        </div>
        <el-row :gutter="10">
          <el-col :span="12">
            <el-form-item label="付款人账号" prop="payerActno">
              <el-input v-model="form.payerActno" placeholder="付款人账号"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-form-item label="付款人名称" prop="payerName">
            <el-input v-model="form.payerName" placeholder="付款人名称"/>
          </el-form-item>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="10">
            <div class="grid-payer">
              <el-form-item label="付款人账户类型" prop="payerActtype">
                <el-input v-model="form.payerActtype" placeholder="付款人账户类型"/>
              </el-form-item>
            </div>
          </el-col>

          <el-col :span="14">
            <el-form-item label="付款清算行行号" prop="payerStBrno" label-width="130px">
              <el-input v-model="form.payerStBrno" placeholder="付款清算行行号"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="10">
            <div class="grid-payer">
              <el-form-item label="付款人开户行所属网银行号" prop="payerOpNetbrno">
                <el-input v-model="form.payerOpNetbrno" placeholder="付款人开户行所属网银行号"/>
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="14">
            <el-form-item label="付款人开户行名称" prop="payerOpBrname" label-width="130px">
              <el-input v-model="form.payerOpBrname" placeholder="付款人开户行名称"/>
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>
      <!--收款人信息-->
      <el-card class="form-card payeeInfo-card">
        <div slot="header" class="label-header-msg">
          <span>收款人信息</span>
        </div>
        <el-row :gutter="10">
          <el-col :span="12">
            <div class="grid-payee">
              <el-form-item label="收款人账号" prop="payeeActno">
                <el-input v-model="form.payeeActno" placeholder="收款人账号"/>
              </el-form-item>
            </div>
          </el-col>
        </el-row>
        <el-form-item label="收款人名称" prop="payeeName">
          <el-input v-model="form.payeeName" placeholder="收款人名称"/>
        </el-form-item>
        <el-row :gutter="10">
          <el-col :span="10">
            <div class="grid-payer">
              <el-form-item label="收款人开户行所属网银行号" prop="payeeOpNetbrno">
                <el-input v-model="form.payeeOpNetbrno" placeholder="收款人开户行所属网银行号"/>
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="14">
            <el-form-item label="收款清算行行号" prop="payeeStBrno" label-width="130px">
              <el-input v-model="form.payeeStBrno" placeholder="收款清算行行号"/>
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>
      <!--其他信息-->
      <el-card class="form-card payOtherInfo-card">
        <div slot="header" class="label-header-msg">
          <span>其他交易信息</span>
        </div>
        <el-row>
          <el-col :span="8">
            <el-form-item label="业务种类编码" prop="bizCode">
              <el-input v-model="form.bizCode" placeholder="业务种类编码"/>
<!--              <el-select v-model="form.bizCode" placeholder="业务类型">
                <el-option
                    v-for="dict in dictMap.IBPS_TYPE"
                    :key="dict.value"
                    :label="`${dict.text}`"
                    :value="dict.value"
                ></el-option>
              </el-select>-->
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <div class="grid-otherInfo">
              <el-form-item label="轧差日期" prop="chkDate">
                <el-date-picker v-model="form.chkDate" style="width: 100%;" type="date" value-format="yyyyMMdd"/>
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="8">
            <el-form-item label="轧差场次" prop="chkRound" >
              <el-input v-model="form.chkRound" placeholder="轧差场次"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <div class="grid-otherInfo">
              <el-form-item label="清算日期" prop="clrDate">
                <el-date-picker v-model="form.clrDate" style="width: 100%;" type="date" value-format="yyyyMMdd"/>
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="8">
            <el-form-item label="加/核签结果" prop="signRslt">
              <el-select v-model="form.signRslt" placeholder="补发标志">
                <el-option
                  v-for="dict in dictMap.IBPS_SIGN_RSLT"
                  :key="dict.value"
                  :label="`${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="补发标志" prop="resndflg">
              <el-select v-model="form.resndflg" placeholder="补发标志">
                <el-option
                  v-for="dict in dictMap.IBPS_RESEND_FLAG"
                  :key="dict.value"
                  :label="`${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <div class="grid-otherInfo">
              <el-form-item label="数字签名" prop="sign">
                <el-input v-model="form.sign" placeholder="数字签名"/>
              </el-form-item>
            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <div class="grid-otherInfo">
              <el-form-item label="附言" prop="remarks">
                <el-input type="textarea" v-model="form.remarks" placeholder="附言" maxlength="210" show-word-limit/>
              </el-form-item>
            </div>
          </el-col>
        </el-row>
      </el-card>

<!--
      附加信息域 根据业务类型，动态显示或隐藏
      <el-card class="form-card payAddInfo-card" v-if="form.bizTypeCode === 'A110'">
        <div slot="header" class="label-header-msg">
          <span>托收承付（划回）</span>
        </div>
        <el-row>
          <el-col :span="12">
            <el-form-item label="票据日期" prop="clltnNotesDate" label-width="110px">
              <el-date-picker
                v-model="form.clltnNotesDate"
                type="date"
                placeholder="选择日期"
                value-format="yyyyMMdd"
              ></el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            &lt;!&ndash;“委托收款（划回）、托收承付（划回）、商业汇票、支票、银行汇票、银行本票、城市商业银行汇票”时：“端到端标识号”填写内容为“票据号码/凭证号码”指实际贸易的标识信息&ndash;&gt;
            <el-form-item label="票据号码" prop="e2eId" label-width="110px">
              <acct-no-input v-model="form.e2eId" placeholder="票据号码"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="支付金额币种" prop="pmtPayCurcd">
              <el-input v-model="form.pmtPayCurcd" disabled/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="支付金额" prop="pmtPayAmount" label-width="110px">
              <ht-amount-input v-model="form.pmtPayAmount" placeholder="支付金额"></ht-amount-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="原托币种" prop="pmtOriCurcd">
              <el-input v-model="form.pmtOriCurcd" disabled/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="原托金额" prop="pmtOriAmount" label-width="110px">
              <ht-amount-input v-model="form.pmtOriAmount" placeholder="原托金额"></ht-amount-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="拒付币种" prop="pmtRejectCurcd">
              <el-input v-model="form.pmtRejectCurcd" disabled/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="拒付金额" prop="pmtRejectAmount" label-width="110px">
              <ht-amount-input v-model="form.pmtRejectAmount" placeholder="拒付金额"></ht-amount-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="赔偿币种" prop="pmtAmendsCurcd">
              <el-input v-model="form.pmtAmendsCurcd" disabled/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="赔偿金额" prop="pmtAmendsAmount" label-width="110px">
              <ht-amount-input v-model="form.pmtAmendsAmount" placeholder="赔偿金额"></ht-amount-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="多付币种" prop="pmtAddCurcd">
              <el-input v-model="form.pmtAmendsCurcd" disabled/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="多付金额" prop="pmtAddAmount" label-width="110px">
              <ht-amount-input v-model="form.pmtAddAmount" placeholder="多付金额"></ht-amount-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>
-->
    </el-form>
    <el-form ref="queryDetailForm101" :model="form" label-width="110px" :disabled="true">
      <query-detail-inter-info
        ref="detailInterInfo"
        :dataDetail="this.form"
        :dictMap="dictMap"
      ></query-detail-inter-info>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="handleClose">关闭</el-button>
    </div>
  </el-dialog>
</template>
<script>

import {detail} from "@/api/ibps/transSearch/transInfo.js";
import HtAmountInput from "@/views/components/HtAmountInput/index.vue";
import HtAmountUpper from "@/views/components/HtAmountUpper/index.vue";
import QueryDetailInterInfo from "./queryDetailInterInfo.vue";

export default {
  name: "QueryDetailDialog",
  components: {
    HtAmountInput,
    HtAmountUpper,
    QueryDetailInterInfo
  },
  props: {
    dictMap: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  data() {
    return {
      detailForm111: {},
      busTypeList: [],
      id: "",
      pkgNo: "",
      title: "",
      // 是否显示弹出层
      openState: false,
      // 表单参数
      form: {
        amount: "0.00",
      },
    };
  },
  mounted() {
  },
  methods: {
    // 关闭回掉
    handleClose() {
      this.openState = false;
    },
    show(id) {
      if (id) {
        this.title = "交易明细";
        this.openState = true;
        detail({
          coreId: id,
        }).then((res) => {
          let data = res.result;
          this.$set(this, "form", data);
          this.openState = true;
        });
      }
    },

    cancel() {
      this.openState = false;
    },
  },
};
</script>
<style>
.label-header-msg {
  font-weight: bold;
}

.form-card {
  margin-bottom: 10px;
}
</style>
